
Function LoadMesh:Int(filename:String)
	getBlitz3D().addResLoc(ExtractDir(filename))
	Local b:B3DEntity = New B3DEntity
	
	b.obj = getBlitz3D()._scenemanager.createEntity("", StripDir(filename), "BlitzOgre3D")
	o_attachObject(_blitzogre3d._rootscenenode.createChildSceneNode()._ptr, Entity(b.obj)._ptr)
	b._typ = Entity(b.obj)._typ
	getBlitz3D()._AddEntity(Entity(b.obj).getName(), b)
	
	Return HandleFromObject(b)
End Function

rem
bbdoc: returns the width of a mesh
about: <b>Note:</b> returns -1 if "m" not a mesh
endrem
Function MeshWidth:Float(m:Int)
	Local obj:B3DEntity = B3DEntity(HandleToObject(m))
	Local w:Float = -1.0
	If obj <> Null
		If obj._typ = ET_ENTITY Or obj._typ = ET_MESH Then w = Mesh(obj.obj).getBounds().GetSize().getX()
	EndIf
	Return w
End Function

rem
bbdoc: returns the height of a mesh
about: <b>Note:</b> returns -1 if "m" not a mesh
endrem
Function MeshHeight:Float(m:Int)
	Local obj:B3DEntity = B3DEntity(HandleToObject(m))
	Local h:Float = -1.0
	If obj <> Null
		If obj._typ = ET_ENTITY Or obj._typ = ET_MESH Then h = Mesh(obj.obj).getBounds().GetSize().getY()
	EndIf
	Return h
End Function

rem
bbdoc: returns the depth of a mesh
about: <b>Note:</b> returns -1 if "m" not a mesh
endrem
Function MeshDepth:Float(m:Int)
	Local obj:B3DEntity = B3DEntity(HandleToObject(m))
	Local d:Float = -1.0
	If obj <> Null
		If obj._typ = ET_ENTITY Or obj._typ = ET_MESH Then d = Mesh(obj.obj).getBounds().GetSize().getZ()
	EndIf
	Return d
End Function